package com.lagou.client;/*
 *Author:cxz
 *@Date:${Date}
 */

import com.alibaba.fastjson.JSON;
import com.lagou.service.Serializer;

/**
 * @ClassName JSONSerializer
 * @Description
 * @Author cxz
 * @Date 2020/5/28 13:46 Version V1.0
 */
public class JSONSerializer implements Serializer {


    public byte[] serialize(Object object) {

        return JSON.toJSONBytes(object);

    }


    public <T> T deserialize(Class<T> clazz, byte[] bytes) {

        return JSON.parseObject(bytes, clazz);

    }
}
